package com.cytech.cloudclinic.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.cytech.cloudclinic.R;
import com.cytech.cloudclinic.bean.Drug;

import java.util.List;

/**
 * 处方模板对应的药品
 */
public class PrescriptionDrugAdapter extends BaseQuickAdapter<Drug, BaseViewHolder> {

    public PrescriptionDrugAdapter( List<Drug> data) {
        super(R.layout.item_priscription_template_drug, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, Drug drug) {
        baseViewHolder.setText(R.id.item_prescription_name,drug.drug_name);
        baseViewHolder.setText(R.id.item_prescription_size,drug.count+drug.count_unit);
        baseViewHolder.setText(R.id.item_prescription_use,drug.usage_mode);
        baseViewHolder.setText(R.id.item_prescription_fre,drug.dosage+drug.dosage_unit+"/"+drug.frequency);
    }
}
